package com.xd.user.api.feign;


import com.xd.common.model.R;
import com.xd.common.constant.ServiceConstant;
import com.xd.user.api.entity.User;
import com.xd.common.base.BaseFeign;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * 用户(User)表Feign
 *
 * @author hbx
 * @since 2019-12-30 18:30:02
 */
@FeignClient(value = ServiceConstant.USER_SERVICE,path = "user")
public interface UserFeign extends BaseFeign<User, String> {
    /**
     * 根据用户名获取用户
     * @param username 用户名
     * @return 用户信息
     */
    @PostMapping("/login")
    R<User> login(@RequestParam  String username);


    @GetMapping("listByDepartmentId/{departmentId}")
    R<List<User>> listByDepartmentId(@PathVariable  String departmentId);
}
